package com.evaluatedetail.model;


import java.util.List;

public class EvaluateDetailService {

	private EvaluateDetailVO_interface dao;

	public EvaluateDetailService() {
		dao = new EvaluateDetailDAO();
	}

	public EvaluateDetailVO addEvaluateDetail( Integer value, 
			String driver_path_id,String rider_path_id,String evaluate_id,String order_id) {

		EvaluateDetailVO evaluatedetailVO = new EvaluateDetailVO();

		evaluatedetailVO.setValue(value);
		evaluatedetailVO.setDriver_path_id(driver_path_id);
		evaluatedetailVO.setRider_path_id(rider_path_id);
		evaluatedetailVO.setEvaluate_id(evaluate_id);
		evaluatedetailVO.setOrder_id(order_id);
		dao.insert(evaluatedetailVO);

		return evaluatedetailVO;
	}

	public EvaluateDetailVO updateEvaluateDetail( Integer value, 
			String driver_path_id,String rider_path_id,String evaluate_id,String order_id) {

		EvaluateDetailVO evaluatedetailVO = new EvaluateDetailVO();
		evaluatedetailVO.setValue(value);
		evaluatedetailVO.setDriver_path_id(driver_path_id);
		evaluatedetailVO.setRider_path_id(rider_path_id);
		evaluatedetailVO.setEvaluate_id(evaluate_id);
		evaluatedetailVO.setOrder_id(order_id);
		dao.update(evaluatedetailVO);

		return evaluatedetailVO;
	}

	public void deleteEvaluateDetail(String driver_path_id) {
		dao.delete(driver_path_id);
	}

	public EvaluateDetailVO getOneEvaluateDetail(String driver_path_id) {
		return dao.findByPrimaryKey(driver_path_id);
	}

	public List<EvaluateDetailVO> getAll() {
		return dao.getAll();
	}
}
